<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
  <meta name="viewport"
        content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0,user-scalable=no,minimal-ui">
  <meta name="description" content="">
  <meta name="author" content="">
  <link rel="icon" href="../img/asset-favico.ico">
  <title>体检套餐详情</title>
  <link rel="stylesheet" href="../css/page-health-orderDetail.css"/>
  <script src="../plugins/vue/vue.js"></script>
  <script src="../plugins/vue/axios-0.18.0.js"></script>
  <script src="../plugins/healthmobile.js"></script>
  <script>
      var id = getUrlParam("id"); //  从当前页面的 URL 查询参数中获取名为 id 的参数值，并将其赋值给变量 id。
  </script>
</head>
<body data-spy="scroll" data-target="#myNavbar" data-offset="150">
<div id="app" class="app">
  <!-- 页面头部 -->
  <div class="top-header">
    <span class="f-left"><i class="icon-back" onclick="history.go(-1)"></i></span>
    <span class="center">体检套餐详情</span>
    <span class="f-right"><i class="icon-more"></i></span>
  </div>
  <!-- 页面内容 -->
  <div class="contentBox">
    <div class="card">
      <!-- 体检套餐广告图片 -->
      <div class="project-img">
        <img :src="imgUrl" width="100%" height="100%"/>
      </div>
      <!-- 体检套餐基本信息 -->
      <div class="project-text">
        <h4 class="tit">{{setmeal.name}}</h4>
        <p class="subtit">{{setmeal.remark}}</p>
        <p class="keywords">
          <span>{{setmeal.sex == '0' ? '性别不限' : setmeal.sex == '1' ? '男':'女'}}</span>
          <span>{{setmeal.age}}</span>
        </p>
      </div>
      <!-- 跳转到预约须知页面 -->
      <div class="project-know">
          <a href="orderNotice.html" class="link-page">
              <i class="icon-ask-circle"><span class="path1"></span><span class="path2"></span></i>
              <span class="word">预约须知</span>
              <span class="arrow"><i class="icon-rit-arrow"></i></span>
          </a>
      </div>
    </div>
    <!-- 体检套餐详情 -->
    <div class="table-listbox">
      <div class="box-title">
        <i class="icon-zhen"><span class="path1"></span><span class="path2"></span></i>
        <span>套餐详情</span>
      </div>
      <div class="box-table">
        <!-- 套餐标题 -->
        <div class="table-title">
          <div class="tit-item flex2">项目名称</div>
          <div class="tit-item  flex3">项目内容</div>
          <div class="tit-item  flex3">项目解读</div>
        </div>
        <!-- 套餐内容 -->
        <div class="table-content">
          <ul class="table-list">
            <li class="table-item" v-for="checkgroup in setmeal.checkGroups">
              <!-- 检查组名称 -->
              <div class="item flex2">{{checkgroup.name}}</div>
              <!-- 检查项 -->
              <div class="item flex3">
                <label v-for="checkitem in checkgroup.checkItems">
                  {{checkitem.name}}
                </label>
              </div>
              <!-- 检查组说明 -->
              <div class="item flex3">{{checkgroup.remark}}</div>
            </li>
          </ul>
        </div>
        <!-- 底部立即预约按钮 -->
        <div class="box-button">
          <a class="order-btn" @click="toOrderInfo">立即预约</a>
        </div>
      </div>
    </div>
  </div>
</div>
<script>
    var vue = new Vue({
        el: '#app',
        data: {
            imgUrl: null, //  套餐对应的图片链接
            setmeal: {}   //  模型数据，用于套餐信息展示
        },
        methods: {
            toOrderInfo() {
                window.location.href = "orderInfo.html?id=" + id;
            }
        },
        mounted() {
            //  发送 ajax 请求，根据套餐 id 查询套餐详细信息（包括套餐基本信息、套餐包含的检查组、检查组包含的检查项）
            axios.post("/setmeal/findById.do?id=" + id).then((response) => {
                if (response.data.flag) {
                    this.setmeal = response.data.data;
                    this.imgUrl = 'http://sx69i7tux.hd-bkt.clouddn.com/' + this.setmeal.img;
                }
            });
        }
    });
</script>
</body>